Skip to content

[bitnami/mariadb] Add initContainerSecurityContext parameter for primary initContainer - #34373

Merged
juan131 merged 6 commits into
bitnami:mainfrom
YunusStar:mariadb-initcontainer-securitycontext
Nov 17, 2025
Merged

[bitnami/mariadb] Add initContainerSecurityContext parameter for primary initContainer#34373
juan131 merged 6 commits into
bitnami:mainfrom
YunusStar:mariadb-initcontainer-securitycontext

Conversation

@YunusStar

Copy link
Copy Markdown
Contributor

Description of the change

This change adds a new primary.initContainerSecurityContext parameter to the MariaDB chart, allowing separate security context configuration for the preserve-logs-symlinks initContainer. Previously, the initContainer shared the same security context as the main MariaDB container (primary.containerSecurityContext), which caused deployment failures in environments with strict security policies.

The change modifies:

  • values.yaml: Adds the new initContainerSecurityContext parameter with full documentation
  • templates/primary/statefulset.yaml: Updates the initContainer to use the new security context parameter
  • Chart.yaml: Bumps version from 20.5.8 to 20.5.9

Benefits

  • Enables MariaDB deployment in Azure environments with strict security policies (e.g., azurepolicy-k8sazurev2selinux)
  • Provides flexibility to configure initContainer security context independently from main container
  • Resolves "SELinux options is not allowed" deployment failures
  • Maintains backward compatibility with sensible defaults
  • Follows established patterns from other Bitnami charts (e.g., MongoDB TLS initContainer)

Possible drawbacks

No known limitations. This is a backward-compatible addition that:

  • Uses the same default values as the existing containerSecurityContext
  • Only affects the initContainer when explicitly configured
  • Maintains existing behavior when not configured

Applicable issues

This resolves deployment issues where Azure security policies deny pods with SELinux options, specifically addressing the error:
SELinux options is not allowed, pod: mariadb-xxx, container mariadb. Allowed options: []

Additional information

This change enables users to set primary.initContainerSecurityContext.seLinuxOptions: null to comply with Azure security policies while maintaining security settings for the main MariaDB container. The implementation follows the same pattern established in other Bitnami charts for handling initContainer-specific configurations.

Checklist

  • Chart version bumped in Chart.yaml according to semver. This is not necessary when the changes only affect README.md files.
  • Variables are documented in the values.yaml and added to the README.md using readme-generator-for-helm
  • Title of the pull request follows this pattern [bitnami/<name_of_the_chart>] Descriptive title
  • All commits signed off and in agreement of Developer Certificate of Origin (DCO)

Signed-off-by: Yıldız, Yunus <dolphinstar121@gmail.com>
@github-actions github-actions Bot added triage Triage is needed mariadb labels Jun 12, 2025
@github-actions
github-actions Bot requested a review from javsalgar June 12, 2025 12:34
Signed-off-by: Bitnami Bot <bitnami.bot@broadcom.com>
Signed-off-by: Bitnami Bot <bitnami.bot@broadcom.com>
@javsalgar javsalgar added verify Execute verification workflow for these changes in-progress labels Jun 13, 2025
@github-actions github-actions Bot removed the triage Triage is needed label Jun 13, 2025
@github-actions
github-actions Bot removed the request for review from javsalgar June 13, 2025 08:54
@github-actions
github-actions Bot requested a review from juan131 June 13, 2025 08:54
Signed-off-by: Bitnami Bot <bitnami.bot@broadcom.com>
@juan131

juan131 commented Jun 13, 2025

Copy link
Copy Markdown
Contributor

Hi @YunusStar

Thanks so much for this contribution! It is actually a great addition. However, if you don't mind, I'll put in on-hold for a couple of weeks given we're planning to introduce some changes in this chart soon that'll conflictive with these ones. Then, we can resume this work. Sorry for the inconveniences.

@juan131 juan131 added the on-hold Issues or Pull Requests with this label will never be considered stale label Jun 13, 2025
@juan131 juan131 removed the on-hold Issues or Pull Requests with this label will never be considered stale label Nov 17, 2025
carrodher and others added 2 commits November 17, 2025 04:54
Signed-off-by: Carlos Rodríguez Hernández <carlos.rodriguez-hernandez@broadcom.com>
Signed-off-by: Bitnami Bot <bitnami.bot@broadcom.com>

@juan131 juan131 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@juan131
juan131 merged commit c414d93 into bitnami:main Nov 17, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mariadb solved verify Execute verification workflow for these changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants